fix: edge case where caret isn't moved to left#37
fix: edge case where caret isn't moved to left#37arikorn wants to merge 2 commits intobitfocus:mainfrom
Conversation
Also carry over change from companion to support dropdown menus with icons.
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughUpdates Changes
Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/css/custom.css (2)
147-149: Tiny comment nit — the leading comment no longer covers both cases.The comment on line 147 says "when the window is narrow, the right-header icons are in the pull-down sidebar," but the rule now also targets
.theme-layout-navbar-right .dropdown__menu, which is visible on wide windows. It's a small thing, but worth a quick update so future readers aren't confused!📝 Suggested comment update
-/* when the window is narrow, the right-header icons are in the pull-down sidebar */ +/* when the window is narrow, the right-header icons are in the pull-down sidebar; + when the window is wide, the right-header icons can also appear in a dropdown menu */
221-236: Heads-up:&::beforeis a no-op for the::afterleg of the combined selector.Inside the shared block,
&::before { scale: 0.6; }resolves to two rules:
.menu__caret::before { scale: 0.6; }— ✅ valid and applied..menu__link--sublist-caret::after::before { scale: 0.6; }— ❌ chained pseudo-elements aren't valid CSS; browsers silently drop it.The actual scaling of
::afteris correctly handled by the new standalone rule at lines 234–236, so the behavior is right! This is purely a readability note — someone skimming the shared block might assume&::beforeapplies to both legs. Totally fine to leave as-is since it works, but splitting the selectors would make the intent crystal-clear:✨ Optional clarity refactor
-/* move the expand/contract caret to the far left for improved visibility/group offsetting. - The second class is active if the subdirectory has no linked-page (so clicking on it just opens the sublist w/o changing the main panel. - */ -.menu__caret, -.menu__link--sublist-caret::after { +/* move the expand/contract caret to the far left for improved visibility/group offsetting. */ +.menu__caret { order: -1; padding-left: 0.45em; padding-right: 0; border-radius: 0.5rem 0 0 0.5rem; /* match the outer box's corner */ &::before { scale: 0.6; } } -/* when there's no linked page, the caret is in '::after' itself, not nested within the element. */ -.menu__link--sublist-caret::after { +/* The second class is active if the subdirectory has no linked-page (so clicking on it just opens the sublist w/o changing the main panel). + The caret is in '::after' itself, not nested within the element. */ +.menu__link--sublist-caret::after { + order: -1; + padding-left: 0.45em; + padding-right: 0; + border-radius: 0.5rem 0 0 0.5rem; scale: 0.6; }
Also carry over change from companion to support dropdown menus with icons.
Summary by CodeRabbit